package com.yami.shop.app.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.web.bind.annotation.*;
import com.yami.shop.service.AppCashRegisterSystemUserService;
import com.yami.shop.bean.cashregisterapp.AppCashRegisterSystemUser;
import org.springframework.http.ResponseEntity;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/auth")
public class AuthController {

    @Autowired
    private AppCashRegisterSystemUserService appCashRegisterSystemUserService;


    //private BCryptPasswordEncoder bCryptPasswordEncoder;



    @PostMapping("register")
    public String registerUser(AppCashRegisterSystemUser appCashRegisterSystemUser){
        /*appCashRegisterSystemUser.setPassword(bCryptPasswordEncoder
                .encode(appCashRegisterSystemUser.getPassword()));*/

        appCashRegisterSystemUserService.save(appCashRegisterSystemUser);
        return "1";
    }








    }
